<?php

namespace addons\helper\controller\wxapp\project;

use addons\helper\controller\wxapp\project\Pbase;


class Discuss extends Pbase
{
    public function _initialize()
    {
        parent::_initialize();
        $this->whereExtend['library_id'] = DISCUSS;
        // $this->whereExtend['investment_total|tmp_investment_total'] = ['>=', 1];
        $groupIds = $this->getGroupIds();
        $this->library_id = DISCUSS;
        $showAna = true;
        if(/*in_array(GROUP_DISTRICTUNIT,$groupIds) || */in_array(GROUP_STREET,$groupIds) || in_array(GROUP_SOE,$groupIds))
        {
            $chargedep_data = $this->getChargedep();
            if($chargedep_data){
                $chargedep_id = $chargedep_data->chargedep_id;
                $this->whereExtend[] = ['exp',Db::raw("FIND_IN_SET($chargedep_id,chargedep_ids)")];
                // $this->assignconfig('chargedep_id',$chargedep_id);
            }
            $showAna = false;
        }
        if(in_array(GROUP_DISTRICTUNIT,$groupIds) || in_array(GROUP_DISTRICTUNIT,$groupIds))
        {
            $this->whereExtend['is_add'] = 1;
            $this->whereExtend['is_visible'] = 1;
        }
    }
}